/**
 * Copyright (c) 2017 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 * @author 张丁方
 * @CreateTime 2017-4-6 17:25:21
 */
package com.hyyt.shopjsp.finance.service.imp;

import com.hyyt.shopjsp.finance.dao.ShopMallCoinWithDrawalsDAO;
import com.hyyt.shopjsp.finance.pojo.ShopMallCoinWithDrawals;
import com.hyyt.shopjsp.finance.service.IShopMallCoinWithDrawalsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import org.apache.log4j.Logger;

@Service
public class ShopMallCoinWithDrawalsService implements IShopMallCoinWithDrawalsService {
    private static final Logger logger = Logger.getLogger(IShopMallCoinWithDrawalsService.class);

    @Resource
    private ShopMallCoinWithDrawalsDAO shopMallCoinWithDrawalsDAO;

    /**
     * 保存SHOP_供应商商城币提现
     *
     * @param shopMallCoinWithDrawals SHOP_供应商商城币提现
     * @return 保存后的SHOP_供应商商城币提现
     */
    @Override
    public void saveShopMallCoinWithDrawals(ShopMallCoinWithDrawals shopMallCoinWithDrawals) {
        shopMallCoinWithDrawalsDAO.insert(shopMallCoinWithDrawals);
    }

    /**
     * 更新SHOP_供应商商城币提现
     *
     * @param shopMallCoinWithDrawals SHOP_供应商商城币提现
     * @return 更新后的SHOP_供应商商城币提现
     */
    @Override
    public void updateShopMallCoinWithDrawals(ShopMallCoinWithDrawals shopMallCoinWithDrawals) {
        shopMallCoinWithDrawalsDAO.update(shopMallCoinWithDrawals);
    }

    /**
     * 删除指定ID的SHOP_供应商商城币提现
     *
     * @param id SHOP_供应商商城币提现ID
     */
    @Override
    public void deleteShopMallCoinWithDrawals(Integer id) {
        shopMallCoinWithDrawalsDAO.delete(id);
    }

    /**
     * 删除指定ID集合的SHOP_供应商商城币提现
     *
     * @param ids SHOP_供应商商城币提现ID集合
     */
    @Override
    public void deleteShopMallCoinWithDrawals(Collection<Integer> ids){
        shopMallCoinWithDrawalsDAO.batchDelete(ids);
    }

    /**
     * 根据ID加载一个SHOP_供应商商城币提现
     *
     * @param id SHOP_供应商商城币提现ID
     * @return SHOP_供应商商城币提现
     */
    @Override
    public ShopMallCoinWithDrawals loadShopMallCoinWithDrawals(Integer id) {
        return shopMallCoinWithDrawalsDAO.load(id);
    }

    /**
     * 查询所有的SHOP_供应商商城币提现，通常有最多取30000条记录的限制
     *
     * @return 所有的SHOP_供应商商城币提现，通常有最多取30000条记录的限制
     */
    @Override
    public List<ShopMallCoinWithDrawals> queryAllShopMallCoinWithDrawals() {
        return shopMallCoinWithDrawalsDAO.queryAll();
    }

    /**
     * 查询SHOP_供应商商城币提现
     *
     * @param params 查询参数，为key-value形式
     * @return SHOP_供应商商城币提现集合
     */
    @Override
    public List<ShopMallCoinWithDrawals> queryShopMallCoinWithDrawals(Map<String, Object> params) {
        return shopMallCoinWithDrawalsDAO.query(params);
    }

    /**
     * 查询SHOP_供应商商城币提现
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_供应商商城币提现集合
     */
    @Override
    public List<ShopMallCoinWithDrawals> queryShopMallCoinWithDrawals(Map<String, Object> params, int startRow, int rowSize) {
        return shopMallCoinWithDrawalsDAO.query(params, startRow, rowSize);
    }

    /**
     * 统计SHOP_供应商商城币提现
     *
     * @param params 查询参数，没有则传null,分页参数key为“sortColumns”
     * @return 结果集记录数
     */
    @Override
    public int countShopMallCoinWithDrawals(Map<String, Object> params) {
        return shopMallCoinWithDrawalsDAO.count(params);
    }
}